package Lib

import (
	"log"
	"wskyygyso/casually/AppInit"
	"wskyygyso/casually/MyRedis"
)

//UserDbGetter 未获取到缓存时,通过数据库获取数据
func UserDbGetter(id string) MyRedis.DbGetterFunc {
	return func() interface{} {
		log.Println("get to db")
		user := NewUserModel()
		AppInit.GetDb().Table("users").Where("id=?", id).Find(user)
		return user
	}
}
